package com.atguigu.webflux.schema;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonProperty;

public class LoginForm {
    @NotBlank(message = "userSession cannot be empty")
    private String userSession;

    @NotBlank(message = "username cannot be empty")
    @Size(min = 2, max = 30, message = "Name must be between 2 and 30 characters long")
    private String username;

    @NotBlank(message = "password cannot be empty")
    @Size(min = 2, max = 30, message = "Name must be between 2 and 30 characters long")
    private String password;

    @JsonProperty("login.x")
    private int loginX;

    @JsonProperty("login.y")
    private int loginY;

    @NotNull(message = "JSFormSubmit is required")
    @NotBlank(message = "JSFormSubmit cannot be empty")
    private String JSFormSubmit;

    // getters and setters...
    public String getUserSession() {
        return userSession;
    }

    public void setUserSession(String userSession) {
        this.userSession = userSession;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getLoginX() {
        return loginX;
    }

    public void setLoginX(int loginX) {
        this.loginX = loginX;
    }

    public int getLoginY() {
        return loginY;
    }

    public void setLoginY(int loginY) {
        this.loginY = loginY;
    }

    public String getJSFormSubmit() {
        return JSFormSubmit;
    }

    public void setJSFormSubmit(String JSFormSubmit) {
        this.JSFormSubmit = JSFormSubmit;
    }
}
